from django.conf.urls.defaults import *

urlpatterns = patterns('mysite.tj3.views',
	# comment
	url(r'^comment/$', 'comment',name='comment'),
	url(r'^graph/$', 'graph',name='graph'),
	
	# project
	url(r'^project/create/$', 'project_create',name='project_create'),
	url(r'^project/compile/(?P<proj_id>\d+)/(?P<scenario_id>\d+)/$', 'project_compile',name='project_compile'),
	url(r'^project/email/$', 'project_email',name='project_email'),
	url(r'^project/performance/(?P<proj_id>\d+)/(?P<scenario_id>\d+)/$','project_performance',name='project_performance'),

	url(r'^$','home',name='home'),
	url(r'^task/status/compare/(?P<proj_id>\d+)/(?P<s1>\d+)/(?P<s2>\d+)/(?P<root>\d+)/(?P<level>\d+)/(?P<type>duration|effort|effortdone|effortleft|complete)/$','task_status_compare',name='task_status_compare'),
	url(r'^budget/compare/(?P<proj_id>\d+)/(?P<s1>\d+)/(?P<s2>\d+)/(?P<root>\d+)/(?P<level>\d+)/(?P<eac_type>\d+)/$','budget_compare',name='budget_compare'),
	url(r'^period/set/(?P<task_id>\d+)/(?P<scenario_id>\d+)/(?P<type>set|start|end|update|cancel)/(?P<complete>\d+)/$', 'period_set', name='period_set'),
	url(r'^resource/load/(?P<proj_id>\d+)/(?P<resource_id>\d+)/(?P<s1>\d+)/(?P<s2>\d+)/(?P<type>daily|weekly|monthly|quarterly)/$','resource_load',name='resource_load'),
	
	# budget
    url(r'^budget/create/(?P<task_id>\d+)/$','budget_create',name='budget_create'),
	url(r'^budget/edit/(?P<budget_id>\d+)/$','budget_edit',name='budget_edit'),

	# task period
    url(r'^period/create/(?P<task_id>\d+)/$','period_create',name='period_create'),
	url(r'^period/edit/(?P<period_id>\d+)/(?P<type>0|1|2|3)/$','period_edit',name='period_edit'),

	# resource allocate
	url(r'^resource/allocate/(?P<task_id>\d+)/$','resource_allocate',name='resource_allocate'),
	url(r'^resource/allocate/remove/(?P<task_id>\d+)/(?P<r_id>\d+)/$', 'resource_allocate_remove',name='resource_allocate_remove'),

	# tasks
	url(r'^task/create/$', 'task_create',name='task_create'),
	url(r'^task/split/(?P<task_id>\d+)/$', 'task_split',name='task_split'),
	url(r'^task/detail/(?P<task_id>\d+)/$','task_detail',name='task_detail'),
	url(r'^task/move/$','task_move',name='task_move'),	
	url(r'^task/edit/$','task_edit',name='task_edit'),
	url(r'^task/delete/(?P<task_id>\d+)/$','task_delete',name='task_delete'),
	url(r'^task/update/(?P<clone>1|0)/$','task_update',name='task_update'),
	url(r'^task/display/(?P<proj_id>\d+)/$','task_hierarchy',name='task_hierarchy'),			
	url(r'^task/gantt/(?P<proj_id>\d+)/(?P<scenario_id>\d+)/$','task_gantt_json',name='task_gantt_json'),
	url(r'^task/datatable/(?P<proj_id>\d+)/(?P<scenario_id>\d+)/$','task_datatable_json',name='task_datatable_json'),
	
	# project main pages
	url(r'^project/main/actual/(?P<proj_id>\d+)/(?P<scenario_id>\d+)/$','project_main_actual',name='project_main_actual'),
	url(r'^project/main/plan/(?P<proj_id>\d+)/$','project_main_plan',name='project_main_plan'),
	url(r'^project/calendar/feeder/(?P<proj_id>\d+)/$','project_calendar_feeder', name='project_calendar_feeder'),
	url(r'^project/calendar/booking/$','project_calendar_booking', name='project_calendar_booking'),
	url(r'^project/calendar/(?P<proj_id>\d+)/(?P<task_id>\d+)/(?P<resource_id>\d+)/$','project_calendar', name='project_calendar'),

	# deps
	url(r'dep/delete/(?P<dep_id>\d+)/$','dep_delete',name='dep_delete'),
	url(r'^dep/edit/(\d+)/$','dep_edit',name='dep_edit'),

    # journal
	url(r'^journal/edit/(?P<journal_id>\d+)/$','journal_edit',name='journal_edit'),
	url(r'^journal/delete/(?P<journal_id>\d+)/$','journal_delete',name='journal_delete'),
	url(r'^journal/create/(?P<booking_id>\d+)/$','journal_create',name='journal_create'),
	url(r'^journal/display/(?P<proj_id>\d+)/$', 'journal_display',name='journal_display'),

	# resource
	url(r'^resource/(\d+)/$','resource_edit',name='resource_edit'),	
	url(r'^resource/create/$','resource_create',name='resource_create'),
	url(r'^resource/manage/$','resource_manage',name='resource_manage'),
		
	# worklimit
	url(r'^worklimit/edit/(\d+)/$','worklimit_edit',name='worklimit_edit'),

	# booking
	url(r'^booking/(?P<booking_id>\d+)/$','booking_edit',name='booking_edit'),

	# timeoff
	url(r'^timeoff/create/(?P<resource_id>\d+)/$', 'timeoff_create',name='timeoff_create'),
	url(r'^timeoff/delete/(?P<timeoff_id>\d+)/$', 'timeoff_delete',name='timeoff_delete'),

	# reports
	url(r'^report/manage/(?P<proj_id>\d+)/$', 'report_manage',name='report_manage'),
	url(r'^report/display/(?P<report_id>\d+)/$', 'report_display',name='report_display'),

	# task reports
	url(r'^report/task/create/(?P<proj_id>\d+)/$', 'taskreport_create',name='taskreport_create'),
	url(r'^report/task/edit/(\d+)/$','taskreport_edit',name='taskreport_edit'),
	url(r'^report/task/delete/(\d+)/$','taskreport_delete',name='taskreport_delete'),
	url(r'^report/task/copy/(\d+)/$','taskreport_copy',name='taskreport_copy'),
	url(r'^report/task/(?P<proj_id>\d+)/(?P<scenario_1>\d+)/(?P<scenario_2>\d+)/$', 'taskreport_view',name='taskreport_view'),
	
	# resource reports
	url(r'^report/resource/create/(?P<proj_id>\d+)/$', 'resourcereport_create',name='resourcereport_create'),
	url(r'^report/resource/edit/(\d+)/$','resourcereport_edit',name='resourcereport_edit'),
	url(r'^report/resource/delete/(\d+)/$','resourcereport_delete',name='resourcereport_delete'),
	url(r'^report/resource/copy/(\d+)/$','resourcereport_copy',name='resourcereport_copy'),

	##########################################
	# Need clean ups
	#########################################
	# resource allocation
	url(r'^resource/allocate/(\d+)/$','resource_allocate_edit',name='resource_allocate_edit'),
	


	# import freemind
	url(r'^import/freemind/$', 'import_freemind',name='import_freemind'),
	url(r'^export/freemind/$', 'export_freemind',name='export_freemind'),

	
		
)
